<script>
	const api = require('@/config/api');
	const util = require('@/utils/util');
	export default {
		onLaunch: function() {
			//获取设备信息
			let that = this;
			uni.getSystemInfo({
				success: function success(res) {
					if (res.platform == 'ios' || res.platform == 'android') {
						that.globalData.isPc = false;
					} else {
						that.globalData.isPc = true;
					}
					that.globalData.windowHeight = res.windowHeight;
					that.globalData.screenHeight = res.screenHeight;
					that.globalData.statusBarHeight = res.statusBarHeight;
				}
			})
			const updateManager = uni.getUpdateManager();
			updateManager.onCheckForUpdate(function(res) {
				console.log(res.hasUpdate);
			});
			updateManager.onUpdateReady(function(res) {
				updateManager.applyUpdate();
			});
		},
		onShow: function() {
			let that = this;
			util.loginNowNew().then(function(res) {
				that.$isResolve();
				util.getMessageCount();
			});
			util.request(api.configUrl).then(function(res) {
				uni.setStorageSync('config', res.data);
			})
		},
		methods: {

		},
		onHide: function() {},
		globalData: {
			dw: 0,
			isPc: false,
			windowHeight: 0,
			screenHeight: 0,
			statusBarHeight: 0,
			shareTitle: api.AppTitle,
		}
	}
</script>

<style lang="scss">
	/* display: flex */
	.df {
		display: flex;
		align-items: center;
	}

	/* 字符串过长省略 */
	.ohto {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.ohto2 {
		display: block;
		white-space: pre-line;
		display: -webkit-box;
		overflow: hidden;
		-webkit-line-clamp: 2;
		text-overflow: ellipsis;
		-webkit-box-orient: vertical;
	}

	/* empty-box */
	.empty-box {
		padding: 150rpx 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.empty-box image {
		padding-bottom: 24rpx;
		width: 450rpx;
		height: 450rpx;
		// animation: fadeIn .6s ease;
	}

	.empty-box .text {
		color: #999;
		font-size: 24rpx;
		font-weight: 500;
	}

	/* button */
	button::after {
		border-radius: 0;
		border: none;
	}

	/* scroll */
	::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
		color: transparent;
	}

	/* 图片延迟加载 */
	@keyframes fadeIn {
		0% {
			opacity: 0;
		}

		50% {
			opacity: 0.5;
		}

		100% {
			opacity: 1;
		}
	}

	/* 没有更多了 */
	.no-more {
		width: 100%;
		height: 60px;
		line-height: 60px;
		text-align: center;
		color: #999;
		font-size: 20rpx;
	}

	/* 自定义提示 */
	.tips-box {
		width: 100%;
		justify-content: center;
	}

	.tips-box .tips-item {
		padding: 0 50rpx;
		height: 100rpx;
		line-height: 100rpx;
		font-size: 24rpx;
		font-weight: bold;
		color: #fff;
		background: rgba(0, 0, 0, .85);
		border-radius: 50rpx;
	}

	/* 默认背景图片 */
	.img-bg {
		background: #ededed url() no-repeat center center;
	}

	/* 摇晃动画 */
	.animate {
		animation: wobble 1.5s .15s linear infinite;
		animation: wobble 1.5s .15s linear infinite;
		animation: wobble 1.5s .15s linear infinite;
		animation: wobble 1.5s .15s linear infinite;
	}

	@-webkit-keyframes wobble {
		10% {
			transform: rotate(15deg);
		}

		20% {
			transform: rotate(-10deg);
		}

		30% {
			transform: rotate(5deg);
		}

		40% {
			transform: rotate(-5deg);
		}

		50%,
		100% {
			transform: rotate(0deg);
		}
	}

	/* 颜色变量 */
	$uni-color: #000000;
	$uni-color-red: #FA5150;
	$uni-color-green: #FFA676;
</style>